import { computed } from 'vue';
import { useUserStore } from '@/stores/user';
import { hasAuth } from '../utils';

/** useAuth hooks */
export const useAuth = () => {
  const userStore = useUserStore();
  const isAdmin = computed(() => {
    return userStore.user.is_admin;
  });
  return {
    isAdmin
  };
};

/** useHasAuth hooks */
export const useHasAuth = (auth: string | number | string[] | number[]) => {
  return computed(() => hasAuth(auth, false));
};
